/******************************************************************************
*
*							Event Manager
*
*******************************************************************************
*
*					Written By: Steven Bankhead
*
*******************************************************************************
*******************************************************************************
*	Still Missing:
*		bool TriggerEvent(EventType event);
*		bool TriggerEvent(char eventName[]);
*		bool ValidateEvent(EventType event);
*			:TriggerEvent - ValidateEvent implementations
*			:QueueEvent - ValidateEvent implementations
******************************************************************************/
#pragma once

#include "Listener.h"
#include "EventType.h"

#include <list>
#include <deque>
#include <fstream>

class EventManager
{
public:
	static EventManager *Instance()
	{
		static EventManager Instance;
		return &Instance;
	}

public:
	EventManager()
	{

	}
	~EventManager(){}
	bool AddListener(Listener listener);
	bool DeleteListener(Listener listener);
	bool QueueEvent(EventType event);
	bool QueueEvent(char eventName[]);
	bool DeleteEvent(EventType event);
	bool DeleteEvent(char eventName[]);
	bool TriggerEvent(EventType event);
	bool TriggerEvent(char eventName[]);
	bool ValidateEvent(EventType event);
	bool ValidateEvent(char eventName[]);
	bool SearchListenerList(Listener listener);
	void PopulateValidEvents();
	void ProcessEvents();

private:
	std::deque<EventType> ActiveEvents;
	std::deque<EventType> EventQueue;
	std::list<Listener> ListenerList;
	std::list<EventType> ValidEvents;
};